import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userName:'',
    clientId:'',
    token:'',
    grade:0,
    email:'',
    login:false,
  },
  mutations: {
    userLogin(state,userInfo){
      state.userName = userInfo['userName']?userInfo['userName']:state.userName;
      state.clientId = userInfo['clientId']?userInfo['clientId']:state.clientId;
      state.token = userInfo['token']?userInfo['token']:state.token;
      state.grade = userInfo['grade']?userInfo['grade']:state.grade;
      state.email = userInfo['email']?userInfo['email']:state.email;
      state.login = true;
    }
  },
  actions: {
  },
  modules: {
  }
})
